import request from '@/utils/request'
export const reqSpuList = (page, limit, category3Id) => request({
  method: 'get',
  url: `/admin/product/${page}/${limit}?category3Id=${category3Id}`
})
// 获取spu 信息
export const reqApu = (spuId) => request({
  method: 'get',
  url: `/admin/product/getSpuById/${spuId}`
})
// 获取品牌信息
export const reqTardMarkList = () => request({
  method: 'get',
  url: `/admin/product/baseTrademark/getTrademarkList`
})
// 获取spu图标的接口
export const reqImageList = (spuId) => request({
  method: 'get',
  url: `/admin/product/spuImageList/${spuId}`
})
// 获取平台的销售属性
export const reqBaseSaleAttrList = () => request({
  method: 'get',
  url: '/admin/product/baseSaleAttrList'
})
// 添加或修改 spu 的请求
export const reqsaveAttr = (data) => request({
  method: 'post',
  url: '/admin/product/saveSpuInfo',
  data
})
// 修改的spu
export const reqEditAttr = (data) => request({
  method: 'post',
  url: '/admin/product/updateSpuInfo',
  data
})
// 删除spu
export const reqDeleteSpu = (spuId) => request({
  method: 'delete',
  url: `/admin/product/deleteSpu/${spuId}`
})
// +sku实例
export const reqattrInfo = (category1Id, category2Id, category3Id) => request({
  method: 'get',
  url: `/admin/product/attrInfoList/${category1Id}/${category2Id}/${category3Id}`
})
// 获取spu销售属性列表
export const reqattrSaleList = (spuId) => request({
  method: 'get',
  url: `/admin/product/spuSaleAttrList/${spuId}`
})
// 获取spu 图片列表
export const reqImgList = (spuId) => request({
  method: 'get',
  url: `/admin/product/spuImageList/${spuId}`
})
// 添加sku
export const reqAddsku = (data) => request({
  method: 'post',
  url: '/admin/product/saveSkuInfo',
  data
})
// 通过当前的spu 查看sku
export const reqSpuById = (spuId) => request({
  method: 'get',
  url: `/admin/product/findBySpuId/${spuId}`
})
